
<#include "header.ftl">
  <!-- 内容区域 -->
<div class="tpl-content-wrapper">
 <div class="container-fluid am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
                        <ol class="am-breadcrumb">
						  <li><a href="${Domain}my" class="am-icon-home">首页</a></li>
						  <li class="am-active">问卷</li>
						  <li class="am-active"><#if type=1>档案</#if><#if type=2>随访</#if></li>
						</ol>
                    </div>
                  	<#include "../common/return.ftl">
                </div>
  </div>
       <div class="row-content am-cf">
                <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title  am-fl"><i class="iask-icon-moban iconfont sidebar-nav-link-logo"></i><#if type=1>档案</#if><#if type=2>随访</#if>问卷</div>
							    <div class="widget-function am-fr">
								<#if user.role==1>
                                    <a href="${Domain}my/survey/add/${type}?url=${url}" class="am-icon-plus"    data-am-popover="{theme: 'success sm',content: '新增问卷', trigger: 'hover focus'}"></a>
                               	</#if>
                                </div>
                            </div>
                            <div class="widget-body  am-fr">

                                <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                                   
                                </div>
                                <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                                   
                                </div>
                                <div class="am-u-sm-12 am-u-md-12 am-u-lg-3 am-fr">
                                	<#include "../common/search.ftl">
                                </div>

                                <div class="am-u-sm-12">
                                
                                
                                
                                <div class="am-scrollable-horizontal">
                                
                                    <table width="100%" class="<#include "../common/table-class.ftl">"  >
                                        <thead>
                                            <tr>
                                                <th width="80px">编号</th>
                                                <th>名称</th>
                                                <th>描述</th>
                                                <#if type==2>
                                                <th>疾病数</th>
                                                </#if>
                                                <th>问题数</th>
                                              <th width="150px">操作</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        <#list page.list as item>
                                            <tr >
                                                 <td>${item.id}</td>
                                                 <td>${item.name}</td>
                                                <td class="am-text-left">${item.description}</td>
                                                <#if type==2>
                                                <td>${item.diseasecount}</td>
                                                </#if>
                                                <td>${item.questioncount}</td>
                                            
                                                <td>
                                              
                                                    <div class="tpl-table-black-operation">
                                                       <a href="${Domain}my/survey/show/${item.id}?url=${url}" target="_blank" class="tpl-table-black-operation-del">
                                                            <i class="am-icon-file-o"></i> 预览                                                        </a>
                                                    	<#if user.id==item.id>
                                                        <a href="${Domain}my/survey/update/${item.id}?url=${url}">
                                                            <i class="am-icon-pencil"></i> 编辑
                                                        </a>
                                                       
                                                        <a href="${Domain}my/survey/question/${item.id}?url=${url}">
                                                            <i class="am-icon-pencil"></i> 问题
                                                        </a>
                                                         <#if type==2>
		                                                <a href="${Domain}my/survey/disease/${item.id}?url=${url}" class="tpl-table-black-operation-del">
                                                            <i class="am-icon-pencil"></i> 疾病
                                                        </a>
		                                                </#if>
														</#if>
                                                    </div>
                                                 
                                                </td>
                                            </tr>
                                            </#list>
                                        </tbody>
                                    </table>
                                    </div>
                                </div>
                              
                               <#include "../common/page.ftl">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        
 </div>     
 
 <script type="text/javascript">
 var loading;
 function deleteItem(id,name,value)
 {
 	weui.confirm('是否删除{'+name+':'+value+'}选项?', 
 	function(){ 
 	   loading =weui.loading('数据删除中...');
 		$.getJSON("${Domain}api/answer/delete", { id: id }, function(json){
		  if(json.status)
		  {
		     if(loading) loading.hide();
	    	 weui.toast(json.msg);
	    	 location.href="${url}";	
		  }else
	    	{	
	    		if(loading) loading.hide();
	    	    weui.alert(json.msg);  		 
	    	}
		});
 	 },
    function(){ console.log('no') });
 }
 </script>     
<#include "footer.ftl">